using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using pesta.Data;
using Pesta.Utilities.Helpers;
using Pesta.DataAccess.Azure;

namespace raya.Models.messages
{
    public static class messagesExtension
    {
#if AZURE
        public static Message ToModel(this MessageRow res)
        {
            Message msg = new Message()
            {
                id = res.id,
                senderId = res.sender,
                body = res.body,
                title = res.title,
                timeSent = res.created.FromUnixTime()
            };
            return msg;
        }
#endif
    }
}
